.TH "src/netconf.h" 3 "Fri Apr 15 2016" "Version 0.10.0-146_trunk" "libnetconf" \" -*- nroff -*-
.ad l
.nh
.SH NAME
src/netconf.h \- 
.PP
libnetconf's general public functions and structures definitions\&.  

.SH SYNOPSIS
.br
.PP
\fC#include <stdint\&.h>\fP
.br
\fC#include <sys/types\&.h>\fP
.br

.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBNC_INIT_ALL\fP   0xffff8fff"
.br
.ti -1c
.RI "#define \fBNC_INIT_CLIENT\fP   0x00004000"
.br
.ti -1c
.RI "#define \fBNC_INIT_DATASTORES\fP   0x00000100"
.br
.ti -1c
.RI "#define \fBNC_INIT_KEEPALIVECHECK\fP   0x00000080"
.br
.ti -1c
.RI "#define \fBNC_INIT_LIBSSH_PTHREAD\fP   0x00000200"
.br
.ti -1c
.RI "#define \fBNC_INIT_MONITORING\fP   0x00000008"
.br
.ti -1c
.RI "#define \fBNC_INIT_MULTILAYER\fP   0x00001000"
.br
.ti -1c
.RI "#define \fBNC_INIT_NACM\fP   0x00000004"
.br
.ti -1c
.RI "#define \fBNC_INIT_NOTIF\fP   0x00000002"
.br
.ti -1c
.RI "#define \fBNC_INIT_SINGLELAYER\fP   0x00002000"
.br
.ti -1c
.RI "#define \fBNC_INIT_URL\fP   0x00000040"
.br
.ti -1c
.RI "#define \fBNC_INIT_VALIDATE\fP   0x00000020"
.br
.ti -1c
.RI "#define \fBNC_INIT_WD\fP   0x00000010"
.br
.ti -1c
.RI "#define \fBNC_INITRET_NOTFIRST\fP   0x00000001"
.br
.ti -1c
.RI "#define \fBNC_INITRET_RECOVERY\fP   0x00000002"
.br
.ti -1c
.RI "#define \fBnc_msgid\fP   char*"
.br
.RI "\fIType representing NETCONF message-id attribute\&. \fP"
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef struct nc_msg \fBnc_ntf\fP"
.br
.RI "\fIEvent notification message\&. \fP"
.ti -1c
.RI "typedef struct nc_msg \fBnc_reply\fP"
.br
.RI "\fIreply message\&. \fP"
.ti -1c
.RI "typedef struct nc_msg \fBnc_rpc\fP"
.br
.RI "\fIrpc message\&. \fP"
.in -1c
.SS "Enumerations"

.in +1c
.ti -1c
.RI "enum \fBNC_CAP_ATTR\fP { \fBNC_CAP_ATTR_WITHDEFAULTS_MODE\fP = 1 }"
.br
.RI "\fIRPC attributes list\&. \fP"
.ti -1c
.RI "enum \fBNC_DATASTORE\fP { \fBNC_DATASTORE_ERROR\fP, \fBNC_DATASTORE_CONFIG\fP, \fBNC_DATASTORE_URL\fP, \fBNC_DATASTORE_RUNNING\fP, \fBNC_DATASTORE_STARTUP\fP, \fBNC_DATASTORE_CANDIDATE\fP }"
.br
.RI "\fIEnumeration of the supported types of datastores defined by NETCONF\&. \fP"
.ti -1c
.RI "enum \fBNC_EDIT_DEFOP_TYPE\fP { \fBNC_EDIT_DEFOP_ERROR\fP = -1, \fBNC_EDIT_DEFOP_NOTSET\fP = 0, \fBNC_EDIT_DEFOP_MERGE\fP = 1, \fBNC_EDIT_DEFOP_REPLACE\fP = 2, \fBNC_EDIT_DEFOP_NONE\fP = 3 }"
.br
.RI "\fIEnumeration of edit-config's <default-operation> element values\&. \fP"
.ti -1c
.RI "enum \fBNC_EDIT_ERROPT_TYPE\fP { \fBNC_EDIT_ERROPT_ERROR\fP = -1, \fBNC_EDIT_ERROPT_NOTSET\fP = 0, \fBNC_EDIT_ERROPT_STOP\fP = 1, \fBNC_EDIT_ERROPT_CONT\fP = 2, \fBNC_EDIT_ERROPT_ROLLBACK\fP = 3 }"
.br
.RI "\fIEnumeration of edit-config's <error-option> element values\&. \fP"
.ti -1c
.RI "enum \fBNC_EDIT_OP_TYPE\fP { \fBNC_EDIT_OP_ERROR\fP = -1, \fBNC_EDIT_OP_MERGE\fP = 1, \fBNC_EDIT_OP_NOTSET\fP = 0, \fBNC_EDIT_OP_REPLACE\fP = 2, \fBNC_EDIT_OP_CREATE\fP, \fBNC_EDIT_OP_DELETE\fP, \fBNC_EDIT_OP_REMOVE\fP }"
.br
.RI "\fIEnumeration of edit-config's operation attribute values\&. \fP"
.ti -1c
.RI "enum \fBNC_EDIT_TESTOPT_TYPE\fP { \fBNC_EDIT_TESTOPT_ERROR\fP = -1, \fBNC_EDIT_TESTOPT_NOTSET\fP = 0, \fBNC_EDIT_TESTOPT_TESTSET\fP = 1, \fBNC_EDIT_TESTOPT_SET\fP = 2, \fBNC_EDIT_TESTOPT_TEST\fP = 3 }"
.br
.RI "\fIEnumeration of edit-config's <test-option> element values\&. \fP"
.ti -1c
.RI "enum \fBNC_ERR_PARAM\fP { \fBNC_ERR_PARAM_TYPE\fP, \fBNC_ERR_PARAM_TAG\fP, \fBNC_ERR_PARAM_SEVERITY\fP, \fBNC_ERR_PARAM_APPTAG\fP, \fBNC_ERR_PARAM_PATH\fP, \fBNC_ERR_PARAM_MSG\fP, \fBNC_ERR_PARAM_INFO_BADATTR\fP, \fBNC_ERR_PARAM_INFO_BADELEM\fP, \fBNC_ERR_PARAM_INFO_BADNS\fP, \fBNC_ERR_PARAM_INFO_SID\fP }"
.br
.ti -1c
.RI "enum \fBNC_FILTER_TYPE\fP { \fBNC_FILTER_UNKNOWN\fP, \fBNC_FILTER_SUBTREE\fP }"
.br
.RI "\fIEnumeration of supported NETCONF filter types\&. \fP"
.ti -1c
.RI "enum \fBNC_MSG_TYPE\fP { \fBNC_MSG_UNKNOWN\fP, \fBNC_MSG_WOULDBLOCK\fP, \fBNC_MSG_NONE\fP, \fBNC_MSG_HELLO\fP, \fBNC_MSG_RPC\fP, \fBNC_MSG_REPLY\fP, \fBNC_MSG_NOTIFICATION\fP = -5 }"
.br
.RI "\fIEnumeration of NETCONF message types\&. \fP"
.ti -1c
.RI "enum \fBNC_NOTIF_TYPE\fP { \fBNC_NTF_UNKNOWN\fP, \fBNC_NTF_BASE\fP }"
.br
.ti -1c
.RI "enum \fBNC_OP\fP { \fBNC_OP_UNKNOWN\fP, \fBNC_OP_GETCONFIG\fP, \fBNC_OP_GET\fP, \fBNC_OP_EDITCONFIG\fP, \fBNC_OP_CLOSESESSION\fP, \fBNC_OP_KILLSESSION\fP, \fBNC_OP_COPYCONFIG\fP, \fBNC_OP_DELETECONFIG\fP, \fBNC_OP_LOCK\fP, \fBNC_OP_UNLOCK\fP, \fBNC_OP_COMMIT\fP, \fBNC_OP_DISCARDCHANGES\fP, \fBNC_OP_CREATESUBSCRIPTION\fP, \fBNC_OP_GETSCHEMA\fP, \fBNC_OP_VALIDATE\fP }"
.br
.RI "\fIEnumeration of supported <rpc> operations\&. \fP"
.ti -1c
.RI "enum \fBNC_REPLY_TYPE\fP { \fBNC_REPLY_UNKNOWN\fP, \fBNC_REPLY_HELLO\fP, \fBNC_REPLY_OK\fP, \fBNC_REPLY_ERROR\fP, \fBNC_REPLY_DATA\fP }"
.br
.RI "\fIEnumeration of <rpc-reply> types\&. \fP"
.ti -1c
.RI "enum \fBNC_RPC_TYPE\fP { \fBNC_RPC_UNKNOWN\fP, \fBNC_RPC_HELLO\fP, \fBNC_RPC_DATASTORE_READ\fP, \fBNC_RPC_DATASTORE_WRITE\fP, \fBNC_RPC_SESSION\fP }"
.br
.RI "\fIEnumeration of <rpc> operation types\&. \fP"
.ti -1c
.RI "enum \fBNC_SESSION_STATUS\fP { \fBNC_SESSION_STATUS_ERROR\fP = -1, \fBNC_SESSION_STATUS_STARTUP\fP = 0, \fBNC_SESSION_STATUS_WORKING\fP = 1, \fBNC_SESSION_STATUS_CLOSING\fP = 2, \fBNC_SESSION_STATUS_CLOSED\fP = 3, \fBNC_SESSION_STATUS_DUMMY\fP = 4 }"
.br
.RI "\fIEnumeration of the possible states of a NETCONF session\&. \fP"
.ti -1c
.RI "enum \fBNC_SESSION_TERM_REASON\fP { \fBNC_SESSION_TERM_CLOSED\fP, \fBNC_SESSION_TERM_KILLED\fP, \fBNC_SESSION_TERM_DROPPED\fP, \fBNC_SESSION_TERM_TIMEOUT\fP, \fBNC_SESSION_TERM_BADHELLO\fP, \fBNC_SESSION_TERM_OTHER\fP }"
.br
.RI "\fIEnumeration of reasons of the NETCONF session termination as defined in RFC 6470\&. \fP"
.ti -1c
.RI "enum \fBNC_TRANSPORT\fP { \fBNC_TRANSPORT_UNKNOWN\fP = -1, \fBNC_TRANSPORT_SSH\fP, \fBNC_TRANSPORT_TLS\fP }"
.br
.RI "\fISupported NETCONF transport protocols enumeration\&. To change currently used transport protocol, call \fBnc_session_transport()\fP\&. \fP"
.ti -1c
.RI "enum \fBNC_VERB_LEVEL\fP { \fBNC_VERB_ERROR\fP, \fBNC_VERB_WARNING\fP, \fBNC_VERB_VERBOSE\fP, \fBNC_VERB_DEBUG\fP }"
.br
.RI "\fIVerbosity levels\&. \fP"
.ti -1c
.RI "enum \fBNCWD_MODE\fP { \fBNCWD_MODE_NOTSET\fP = 0, \fBNCWD_MODE_ALL\fP = 1, \fBNCWD_MODE_TRIM\fP = 2, \fBNCWD_MODE_EXPLICIT\fP = 4, \fBNCWD_MODE_ALL_TAGGED\fP = 8, \fBNCWD_MODE_IMPL_TAGGED\fP = 16 }"
.br
.RI "\fIEnumeration of <with-defaults> element values\&. \fP"
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "int \fBnc_close\fP (void)"
.br
.RI "\fIRelease libnetconf resources\&. Init flag is used to determine if close should be applied as system-wide (NC_INIT_MULTILAYER) or not (NC_INIT_SINGLELAYER)\&. System-wide \fBnc_close()\fP closes all the shared structures if no other libnetconf participant is currently running\&. Local release of the calling instance from the shared structures is done in both cases\&. \fP"
.ti -1c
.RI "time_t \fBnc_datetime2time\fP (const char *datetime)"
.br
.RI "\fITransform given string in RFC 3339 compliant format to the time_t (seconds since the epoch) accepted by most Linux functions\&. \fP"
.ti -1c
.RI "void \fBnc_hello_timeout\fP (int timeout)"
.br
.RI "\fISet <hello> timeout - how long libnetconf will wait for the <hello> message from the other side\&. Default value is -1 (infinite timeout)\&. \fP"
.ti -1c
.RI "int \fBnc_init\fP (int flags)"
.br
.RI "\fIInitialize libnetconf for system-wide usage\&. This initialization is shared across all the processes\&. \fP"
.ti -1c
.RI "char * \fBnc_time2datetime\fP (time_t time, const char *tz)"
.br
.RI "\fITransform given time_t (seconds since the epoch) into the RFC 3339 format accepted by NETCONF functions\&. \fP"
.ti -1c
.RI "void \fBnc_verb_error\fP (const char *format,\&.\&.\&.)"
.br
.RI "\fIFunction for logging error messages\&. \fP"
.ti -1c
.RI "void \fBnc_verb_verbose\fP (const char *format,\&.\&.\&.)"
.br
.RI "\fIFunction for logging verbose messages\&. \fP"
.ti -1c
.RI "void \fBnc_verb_warning\fP (const char *format,\&.\&.\&.)"
.br
.RI "\fIFunction for logging warning messages\&. \fP"
.ti -1c
.RI "void \fBnc_verbosity\fP (\fBNC_VERB_LEVEL\fP level)"
.br
.RI "\fISet libnetconf's verbosity level\&. \fP"
.in -1c
.SH "Detailed Description"
.PP 
libnetconf's general public functions and structures definitions\&. 


.PP
\fBAuthor:\fP
.RS 4
Radek Krejci rkrejci@cesnet.cz Copyright (c) 2012-2014 CESNET, z\&.s\&.p\&.o\&.
.RE
.PP
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
.IP "1." 4
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\&.
.IP "2." 4
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\&.
.IP "3." 4
Neither the name of the Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission\&.
.PP
.PP
ALTERNATIVELY, provided that this notice is retained in full, this product may be distributed under the terms of the GNU General Public License (GPL) version 2 or later, in which case the provisions of the GPL apply INSTEAD OF those given above\&.
.PP
This software is provided ``as is, and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed\&. In no event shall the company or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage\&. 
.SH "Macro Definition Documentation"
.PP 
.SS "#define NC_INIT_ALL   0xffff8fff"
\fBnc_init()\fP's flag to enable all optional features/subsystems 
.SS "#define NC_INIT_CLIENT   0x00004000"
\fBnc_init()\fP's flag for NETCONF clients 
.SS "#define NC_INIT_DATASTORES   0x00000100"
\fBnc_init()\fP's flag to use internal datastores 
.SS "#define NC_INIT_KEEPALIVECHECK   0x00000080"
\fBnc_init()\fP's flag to enable check of monitored sessions\&. Sometimes the process holding a monitored session crashes and status information of the session is not properly removed from the monitored sessions list\&. If this option is used, libnetconf checks if the process holding the session is still alive\&. To do this properly, the session is connected with the PID of the \fBnc_session_monitor()\fP caller\&. If the PID changes (e\&.g\&. after fork() or daemon()), the process is supposed to call \fBnc_session_monitor()\fP againg\&. 
.SS "#define NC_INIT_LIBSSH_PTHREAD   0x00000200"
\fBnc_init()\fP's flag to initialize libssh pthread callbacks 
.SS "#define NC_INIT_MONITORING   0x00000008"
\fBnc_init()\fP's flag to enable ietf-netconf-monitoring module 
.SS "#define NC_INIT_MULTILAYER   0x00001000"
\fBnc_init()\fP's flag for multi-layer server architecture 
.SS "#define NC_INIT_NACM   0x00000004"
\fBnc_init()\fP's flag to enable Acccess Control subsystem 
.SS "#define NC_INIT_NOTIF   0x00000002"
\fBnc_init()\fP's flag to enable Notification subsystem\&. 
.SS "#define NC_INIT_SINGLELAYER   0x00002000"
\fBnc_init()\fP's flag for single-layer server architecture 
.SS "#define NC_INIT_URL   0x00000040"
\fBnc_init()\fP's flag to enable server's URL capability 
.SS "#define NC_INIT_VALIDATE   0x00000020"
\fBnc_init()\fP's flag to enable server's validation capability 
.SS "#define NC_INIT_WD   0x00000010"
\fBnc_init()\fP's flag to enable with-default capability 
.SS "#define NC_INITRET_NOTFIRST   0x00000001"
\fBnc_init()\fP's return flag for this process not calling \fBnc_init()\fP first 
.SS "#define NC_INITRET_RECOVERY   0x00000002"
\fBnc_init()\fP's return flag for this process crashing before (not calling \fBnc_close()\fP) 
.SH "Enumeration Type Documentation"
.PP 
.SS "enum \fBNC_ERR_PARAM\fP"

.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fINC_ERR_PARAM_TYPE \fP\fP
error-type - The conceptual layer that the error occurred, accepted values include 'transport', 'rpc', 'protocol', 'application'\&. 
.TP
\fB\fINC_ERR_PARAM_TAG \fP\fP
error-tag - Contains a string identifying the error condition\&. 
.TP
\fB\fINC_ERR_PARAM_SEVERITY \fP\fP
error-severity - The error severity, accepted values are 'error' and 'warning'\&. 
.TP
\fB\fINC_ERR_PARAM_APPTAG \fP\fP
error-app-tag - Contains a string identifying the data-model-specific or implementation-specific error condition, if one exists\&. This element will not be present if no appropriate application error-tag can be associated with a particular error condition\&. If both a data-model-specific and an implementation-specific error-app-tag exist then the data-model-specific value MUST be used by the server\&. 
.TP
\fB\fINC_ERR_PARAM_PATH \fP\fP
error-path - Contains an absolute XPath expression identifying the element path to the node that is associated with the error being reported\&. 
.TP
\fB\fINC_ERR_PARAM_MSG \fP\fP
error-message - A string describing the error\&. 
.TP
\fB\fINC_ERR_PARAM_INFO_BADATTR \fP\fP
bad-attribute in error-info - name of the attribute, contained in the 'bad-attribute', 'missing-attribute' and 'unknown-attribute' errors\&. 
.TP
\fB\fINC_ERR_PARAM_INFO_BADELEM \fP\fP
bad-element in error-info - name of the element, contained in 'missing-attribute', bad-attribute', 'unknown-attribute', 'missing-element', 'bad-element', 'unknown-element' and 'unknown-namespace' errors\&. 
.TP
\fB\fINC_ERR_PARAM_INFO_BADNS \fP\fP
bad-namespace in error-info - name of an unexpected namespace, contained in the 'unknown-namespace' error\&. 
.TP
\fB\fINC_ERR_PARAM_INFO_SID \fP\fP
session-id in error-info - session ID of the session holding the requested lock, contained in 'lock-denied' error\&. 
.SS "enum \fBNC_NOTIF_TYPE\fP"

.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fINC_NTF_UNKNOWN \fP\fP
.TP
\fB\fINC_NTF_BASE \fP\fP
.SH "Author"
.PP 
Generated automatically by Doxygen for libnetconf from the source code\&.
